<template>
	<el-dialog title="" width="70%" visible :show-close="false" :modal-append-to-body="false" class="wrap">
		<i class="el-icon-close close" @click="cancel" style="color: white;"></i>
		<div class="bt">{{vtitle}}</div>
		<el-form label-width="100px" class="form">
			<div class="zzz">
				<div class="an" style="width: 100%;text-align: center;float: left;">
					<el-button type="warning" class="submit" style="float: left;margin-right: 5px;" @click="cancel">关闭</el-button>
					<el-button type="success" class="submit" style="float: left;margin-right: 5px;" @click="submit(1)">保存</el-button>
					<el-button type="primary" :v-if="this.btnshowkb" class="submit" style="float: left;margin-right: 5px" @click="kaiban">正式开班</el-button>
					<el-button type="danger" v-if="form.issys=='N'" class="submit" style="float: left;margin-right: 5px" @click="jiesan">解散班级</el-button>
				</div>
				<div class="left" style="float: left;width: 50%; margin-top: 10px;">
					<el-form-item label="班级名称">
						<el-input v-model="form.mc" placeholder="请输入" class="select-block"></el-input>
					</el-form-item>
					<el-form-item label="课程名称">
						<el-select v-model="form.fxkcid" placeholder="请选择课程" class="select-block">
							<el-option :label="v.mc" :value="v.id+''" v-for="v in xzkclist"></el-option>
						</el-select>
						<!--<p style="height:20px; font-size16px; line-height:20px;">剩余课时数量({{form.kscnt}})</p>-->
					</el-form-item>

					<el-form-item label="老师名称">
						<el-select v-model="form.lsid" class="select-block">
							<el-option :label="v.mc" :value="v.id" v-for="v in comboxlist"></el-option>
						</el-select>
					</el-form-item>
				</div>
				<div class="right" style="float: left;width: 50%;margin-top: 10px;">
					<el-form-item label="行政老师">
						<el-select v-model="form.xzid" class="select-block">
							<el-option :label="v.xslsmc" :value="v.xzlsid+''" v-for="v in xzlsList"></el-option>
						</el-select>
					</el-form-item>

					<el-form-item label="教材名称">
						<el-input v-model="form.jcmc" placeholder="请选择教材名称" class="select-block1" icon="add" :readonly="true"></el-input>
						<el-button size="small" @click="showwp()" class="select-block2">选择</el-button>

					</el-form-item>

					<el-form-item label="开班日期">
						<el-date-picker v-model="form.yjkbrq" type="date" class="select-block" placeholder="选择日期" @keyup.enter.native="search"> </el-date-picker>
					</el-form-item>

				</div>

				<div style="float: left;width: 100%;">
					<el-form-item label="备注">
						<el-input v-model="form.note" placeholder="" style="width:80%;"></el-input>

					</el-form-item>
				</div>

			</div>
			<hr/>
			<div style="width: 100%;height: 50px; overflow: hidden;line-height: 50px;">
				<span style="width: 100px; font-size: 25px; margin-left: 65px;">{{form.mc}}课表</span>
				<el-button type="warning" size="small " style="float: right;margin-right: 65px; margin-top: 10px;" @click="czkb()">重置课表</el-button>
			</div>
			<ul class="kblistul">
				<li style="cursor:pointer;" v-for="i in this.kblistul" @click="daike(i)" :class="(i.issk=='Y'? 'red':'red2')":style="i.iscf > 0 || i.lsiscf > 0? 'background:red;color:#fff':'background:#fff'">
					<p>{{i.sj}}</p>
					<p>{{i.week}}</p>
					<p>{{i.jsmc}}</p>
					<p>{{i.dklsmc ? i.dklsmc : i.zwm}}</p>
					<p>{{i.sjd}}</p>
				</li>
			</ul>
			<!--<PayArticle class="wpfl1" @jcarticle="jcarticleed" @close="jcarticlecancel" v-if="showarticle"></PayArticle>-->
			<Bjxs @bjxs="bjxsed" @close="bjxscancel" v-if="showbjxs"></Bjxs>
			<Kschoose :params="form.fxkcid" @close="wpchoosecancel" v-if="showchoselist"></Kschoose>
			<Czkb @close="cloczkb" :params="this.form" v-if="showczkblist"></Czkb>
			<Jskb class="lskb" @close="jskbcancel" v-if="showjskblist" :params="this.form.jsid"></Jskb>
			<Lskb class="lskb" @close="lskbcancel" v-if="showlskblist" :params="this.form.lsid"></Lskb>
			<Jslskb class="lskb" @close="jslskbcancel" v-if="showjslskblist" :params="this.form"></Jslskb>
			<DyjkComponent v-if="portComponents.dyjk.toggle" @close="componentsHide" :params="this.form.id"></DyjkComponent>
			<DaikeComponent v-if="classtable" @close="showdaike" :params="this.sjdlist"></DaikeComponent>
		</el-form>

	</el-dialog>
</template>
<script type="text/javascript">
	import qs from 'qs'
	import DaikeComponent from '@/view/educa/banjicourse/edit'
	import Kschoose from '../../manage/kssz/kschoose'
	import Czkb from './czkb'
	import PayArticle from './pay-articlejc'
	import Bjxs from './bjxs'
	// import Jskb from './kebiao/jskb'
	import Lskb from './kebiao/lskb'
	import Jskb from './kebiao/jskb'
	import Jslskb from './kebiao/jslskb'
	import DyjkComponent from './dyjk'
	export default {
		props: ['params'],
		components: {
			Kschoose,
			PayArticle,
			Bjxs,
			Lskb,
			Jskb,
			Jslskb,
			DyjkComponent,
			DaikeComponent,
			Czkb
		},
		data() {
			return {
				classtable:false,
				zwm: '',
				ywm: '',
				xb: '',
				dh: '',
				csrq: '',
				vtitle: '班级信息',
				btnshowkb: false,
				activeName: '1',

				form: {
					mc: '',
					lsmc: '',
					lsid: '',
					xzid: '',
					cmc: '',
					jcmc: '',
					issys:'',
					isqy: '',
					fxkcid: '',
					id: '',
					xzls: '',
					yjkbrq: '',
					kbsjd: '',
					note: '',
					xzlsmc: '',
					kss: '',
					jsid: '',
					kccnt: '',
				},
				kblistul: [],
				jssjdlist: [],
				cllist: [],
				clo: {
					id: '',
					str: ''
				},
				vkcid: '',
				xzkclist: [],
				xzlsList: [],
				comboxlist: [],
				xsdataList: [],
				//				kbdataList: [],
				but: '',
				butday1: '',
				butday2: '',
				butday3: '',
				butday4: '',
				butday5: '',
				butday6: '',
				butday7: '',
				butvallist: [],
				jslist: [],
				sjdboxlist: [],
				showchoselist: false,
				showczkblist: false,
				dialogTableVisible: false,
				showarticle: false,
				showbjxs: false,
				showjskblist: false,
				showlskblist: false,
				showjslskblist: false,
				wek: 0,
				// 分页
				layout: 'total, sizes, prev, pager, next, jumper', //组件布局
				pageindex: this.$store.state.pageindex, //当前分页页码
				pagesizes: this.$store.state.pagesizes, //显示个数的选择器选项
				pagesize: this.$store.state.pagesize, //每页显示条目数
				total: 0, //总条数
				/*组件区域*/
				portComponents: {
					dyjk: {
						type: 'dyjk',
						toggle: false,
						params: '',
						data: {}
					}
				},

				value2: '',
			}
		},

		created() {
			
			if(this.params.id) {
				this.form.id = this.params.id;
				if(this.params.ifys = 'N') {
					this.vtitle = '预设班级信息';
					this.btnshowkb = true;
				} else {
					this.vtitle = '班级信息';
					this.btnshowkb = false;
				}
			} else {
				this.form.id = this.params.row.id;
				if(this.params.row.ifys == 'N') {
					this.vtitle = '预设班级信息';
					this.btnshowkb = true;
				} else {
					this.vtitle = '班级信息';
					this.btnshowkb = false;
				} 
			}
			this.loadinfo(); //info
			this.getkblist()
			this.getcllist();
			this.getcomboxlist(); //laoshi
			this.getcomboxlist1(); //xingzheng
			this.setbtnday(0);
			this.getxzkclist();

			//this.xs();
			//			this.kb();
		},

		methods: {
			getkblist(){
				var logininfo = JSON.parse(localStorage.logininfo);
				var params2 = qs.stringify({
					xxid: logininfo.xxid,
					yhid: logininfo.id,
					bjid: this.form.id,
					isys: 'N',
				})
				//执行
				this.axios.post(this.$store.state.api + 'ysbj/getbjkb', params2)
					.then(res => {
						this.kblistul = res.data.data.aa
						console.log(res,9999)
					}).catch(res => {
						this.$message.warning("服务器异常");
						this.$store.state.loading = false;
					})
			},
			daike(list){
				this.sjdlist = list
				this.classtable = true
			},
			showdaike(){
				this.classtable = false
				this.getkblist()
			},
			czkb() {
				this.showczkblist = true;
			},
			cloczkb() {
				this.showczkblist = false;
				this.getkblist()
			},
			addDate(date, days) {
				var d = new Date(date);
				d.setDate(d.getDate() + days);
				return d
			},
			getFormatDatemmdd(date) {
				var seperator1 = "-";
				var year = date.getFullYear();
				var month = date.getMonth() + 1;
				var strDate = date.getDate();
				if(month >= 1 && month <= 9) {
					month = "0" + month;
				}
				if(strDate >= 0 && strDate <= 9) {
					strDate = "0" + strDate;
				}
				// var currentdate = year + seperator1 + month + seperator1 + strDate;
				var currentdate = month + seperator1 + strDate;
				return currentdate;
			},
			getFormatDate(date) {
				var seperator1 = "-";
				var year = date.getFullYear();
				var month = date.getMonth() + 1;
				var strDate = date.getDate();
				if(month >= 1 && month <= 9) {
					month = "0" + month;
				}
				if(strDate >= 0 && strDate <= 9) {
					strDate = "0" + strDate;
				}
				var currentdate = year + seperator1 + month + seperator1 + strDate;
				return currentdate;
			},
			setbtnday(wekstep) {
				if(wekstep == 0) {
					this.wek = 0;
				} else {
					this.wek = this.wek + wekstep;
				}
				this.butvallist = [];
				var d = this.addDate(new Date(), this.wek);
				var wk = d.getDay();

				var dd = this.addDate(d, (1 - wk));
				this.butday1 = this.getFormatDatemmdd(dd);
				this.butvallist.push(this.getFormatDate(dd));
				dd = this.addDate(d, (2 - wk));
				this.butday2 = this.getFormatDatemmdd(dd);
				this.butvallist.push(this.getFormatDate(dd));
				dd = this.addDate(d, (3 - wk));
				this.butday3 = this.getFormatDatemmdd(dd);
				this.butvallist.push(this.getFormatDate(dd));
				dd = this.addDate(d, (4 - wk));
				this.butday4 = this.getFormatDatemmdd(dd);
				this.butvallist.push(this.getFormatDate(dd));
				dd = this.addDate(d, (5 - wk));
				this.butday5 = this.getFormatDatemmdd(dd);
				this.butvallist.push(this.getFormatDate(dd));
				dd = this.addDate(d, (6 - wk));
				this.butday6 = this.getFormatDatemmdd(dd);
				this.butvallist.push(this.getFormatDate(dd));
				dd = this.addDate(d, (7 - wk));
				this.butday7 = this.getFormatDatemmdd(dd);
				this.butvallist.push(this.getFormatDate(dd));

				// this.sxsjd();
			},
			sxsjd() {
				var logininfo = JSON.parse(localStorage.logininfo);
				var vtime = this.butvallist[(this.but - 1)];
				var wek = this.but;
				if(wek == 7) {
					wek = 0;
				}
				this.searchLoading = true;
				var params2 = qs.stringify({
					lsid: this.form.lsid,
					time: vtime,
					week: wek,
					xxid: logininfo.xxid,
					yhid: logininfo.id,
				})
				//执行
				this.axios.post(this.$store.state.api + 'bj/lskb', params2)
					.then(res => {
						console.log(res, 111)
						this.jssjdlist = res.data.data.list
						this.searchLoading = false;
					}).catch(res => {})
			},
			getcllist() {
				this.cllist = [];
				for(var i in this.jssjdlist) {
					if(this.jssjdlist[i].chk1 == true) {
						var aa = {
							jsid: this.jssjdlist[i].jsid,
							id: this.jssjdlist[i].sjdid1,
							sjd: this.jssjdlist[i].sjd1,
							jsmc: this.jssjdlist[i].jsmc,
							bjtime: this.jssjdlist[i].bjtime,
							week: this.jssjdlist[i].week
						};
						this.cllist.push(aa);
					}
					if(this.jssjdlist[i].chk2 == true) {
						var aa = {
							jsid: this.jssjdlist[i].jsid,
							id: this.jssjdlist[i].sjdid2,
							sjd: this.jssjdlist[i].sjd2,
							jsmc: this.jssjdlist[i].jsmc,
							bjtime: this.jssjdlist[i].bjtime,
							week: this.jssjdlist[i].week
						};
						this.cllist.push(aa);
					}
					if(this.jssjdlist[i].chk3 == true) {
						var aa = {
							jsid: this.jssjdlist[i].jsid,
							id: this.jssjdlist[i].sjdid3,
							sjd: this.jssjdlist[i].sjd3,
							jsmc: this.jssjdlist[i].jsmc,
							bjtime: this.jssjdlist[i].bjtime,
							week: this.jssjdlist[i].week
						};
						this.cllist.push(aa);
					}
					if(this.jssjdlist[i].chk4 == true) {
						var aa = {
							jsid: this.jssjdlist[i].jsid,
							id: this.jssjdlist[i].sjdid4,
							sjd: this.jssjdlist[i].sjd4,
							jsmc: this.jssjdlist[i].jsmc,
							bjtime: this.jssjdlist[i].bjtime,
							week: this.jssjdlist[i].week
						};
						this.cllist.push(aa);
					}
					if(this.jssjdlist[i].chk5 == true) {
						var aa = {
							jsid: this.jssjdlist[i].jsid,
							id: this.jssjdlist[i].sjdid5,
							sjd: this.jssjdlist[i].sjd5,
							jsmc: this.jssjdlist[i].jsmc,
							bjtime: this.jssjdlist[i].bjtime,
							week: this.jssjdlist[i].week
						};
						this.cllist.push(aa);
					}
					if(this.jssjdlist[i].chk6 == true) {
						var aa = {
							jsid: this.jssjdlist[i].jsid,
							id: this.jssjdlist[i].sjdid6,
							str: this.jssjdlist[i].sjd6,
							jsmc: this.jssjdlist[i].jsmc,
							bjtime: this.jssjdlist[i].bjtime,
							week: this.jssjdlist[i].week
						};
						this.cllist.push(aa);
					}
				}
				//  var aa ={id:1,str:'dfsfsa' };
				// this.cllist.push(aa);
			},
			bj() {
				var logininfo = JSON.parse(localStorage.logininfo);
				this.searchLoading = true;
				var params2 = qs.stringify({
					xxid: logininfo.xxid,
					yhid: logininfo.id,
					kcid: this.form.fxkcid
				})
				//执行
				this.axios.post(this.$store.state.api + 'bj/zdgetbjmc', params2)
					.then(res => {
						console.log(res)
						this.form.mc = res.data.data.list[0].bjmc;
						this.searchLoading = false;
					}).catch(res => {})

			},

			lskb() {
				this.showlskblist = true;
			},
			jslskb() {
				this.showjslskblist = true;
			},
			jskb() {
				this.showjskblist = true;
			},
			jskb2() {
				this.submit(2)
			},
			lskbcancel(setting) {
				this.showlskblist = false;
			},
			jslskbcancel(setting) {

				this.showjslskblist = false;
			},
			jskbcancel(setting) {
				//				 if(setting.cancel == false){
				//				 	this.vfxkcid = setting.data[0].id;
				//				 	this.vfxkcidmc = setting.data[0].mc;
				//				 	this.vkssl = setting.data[0].number;
				//				 }
				this.showjskblist = false;
			},

			getxzkclist() {
				var logininfo = JSON.parse(localStorage.logininfo);
				this.searchLoading = true;
				var params2 = qs.stringify({
					yhid: logininfo.id,
					xxid: logininfo.xxid
				})
				//执行
				this.axios.post(this.$store.state.api + 'kcfl/getfllist', params2)
					.then(res => {
						console.log(res, 11)
						this.xzkclist = res.data.data.list;
					}).catch(res => {
						console.log(res)
					})
			},

			everefbjlit() {
				Hub.$emit('change', 'hehe'); //Hub触发事件
			},
			xs() {
				var logininfo = JSON.parse(localStorage.logininfo);
				this.searchLoading = true;
				var params2 = qs.stringify({
					zwm: this.zwm,
					ysbjid: this.form.id + '',
					yhid: logininfo.id + '',
					xxid: logininfo.xxid + '',
					pageindex: 1,
					pagesize: 1000,
				})
				//执行
				this.axios.post(this.$store.state.api + 'xs/getysbjxss', params2)
					.then(res => {
						console.log(res)
						let data = res.data.data;
						let list = data.list;
						this.xsdataList = list;
						this.searchLoading = false;
					}).catch(res => {
						console.log(res)
						this.searchLoading = false;
					})
			},
			showwp() {
				this.showchoselist = true;
			},
			showjc() {
				this.showarticle = true;
			},
			//			kaiban(add) {
			//				alert(add)
			//				this.showbjxs = true;
			//			},

//			jcarticleed(josndata) {
//				console.log(josndata)
//				this.form.cid = josndata.cid;
//				this.form.jcid = josndata.jcid;
//				this.form.jcmc = josndata.jcidmc;
//				this.showarticle = false;
//			},
			bjxsed(josndata) {
				this.showbjxs = false;
			},
			getsjdlist() {
				var logininfo = JSON.parse(localStorage.logininfo);
				this.searchLoading = true;
				var params2 = qs.stringify({
					jsid: this.form.jsid
				})
				//执行
				this.axios.post(this.$store.state.api + 'jssjd/mc', params2)
					.then(res => {
						let data = res.data.data;
						this.sjdboxlist = data;
						this.getysbjpksjd();
					}).catch(res => {})
			},
			wpchoosecancel(josndata) {
				console.log(josndata, 111)
				if(josndata.data) {
					this.form.jcmc = josndata.data[0].mc;
					this.form.jcid = josndata.data[0].id;
					this.showchoselist = false;
				} else {
					this.showchoselist = false;
				}
				//				alert(this.form.fxkcmc)
			},
			jcarticlecancel() {
				this.showarticle = false;
			},
			bjxscancel() {
				this.showbjxs = false;
			},
			getcomboxlist() {
				var logininfo = JSON.parse(localStorage.logininfo);
				this.searchLoading = true;
				var params2 = qs.stringify({
					yhid: logininfo.id,
					xxid: logininfo.xxid
				})
				//执行
				this.axios.post(this.$store.state.api + 'ls/getlslist', params2)
					.then(res => {
						let data = res.data.data;
						let list = data.list;
						this.comboxlist = list;
					}).catch(res => {
						console.log(res)
						this.searchLoading = false;
					})
			},
			getcomboxlist1() {
				var logininfo = JSON.parse(localStorage.logininfo);
				this.searchLoading = true;
				var params2 = qs.stringify({
					yhid: logininfo.id,
					xxid: logininfo.xxid
				})
				//执行
				this.axios.post(this.$store.state.api + 'ls/xzxzls', params2)
					.then(res => {
						this.xzlsList = res.data.data;
					}).catch(res => {
						console.log(res)
					})
			},
			loadinfo() {
				var logininfo = JSON.parse(localStorage.logininfo);
				this.searchLoading = true;
				var params2 = qs.stringify({
					xxid: logininfo.xxid,
					yhid: logininfo.id,
					id: this.form.id
				})
				//执行
				this.axios.post(this.$store.state.api + 'ysbj/info', params2)
					.then(res => {
//						this.kblistul = res.data.data.aa
						this.form.mc = res.data.data.mc
						this.form.jcmc = res.data.data.jcmc
						this.form.jcid = res.data.data.jcid
						this.form.cid = res.data.data.cid

						this.form.fxkcmc = res.data.data.fxkcmc
						this.form.fxkcid = res.data.data.fxkcid

						this.form.lsmc = res.data.data.lsmc
						this.form.yjkbrq = res.data.data.yjkbrq
						this.form.kss = res.data.data.kss
						this.form.xzid = res.data.data.xzid
						this.form.kscnt = res.data.data.kss
						this.form.jsid = res.data.data.jsid
						this.form.lsid = res.data.data.lsid
						this.form.note = res.data.data.note
						this.form.issys = res.data.data.issys

						// this.getsjdlist();
					}).catch(res => {
						this.$emit('close', {
							type: 'info',
							cancel: true
						});
					})
			},
			kaiban() {
				this.$confirm('此操作将预设班级转为正式班级, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					var params2 = qs.stringify({
						id: this.form.id
					})
					//执行
					this.axios.post(this.$store.state.api + 'ysbj/kb', params2)
						.then(res => {
							if(res.data.code == 1) {
								this.$message({type: 'success',message: '开班成功!'});
								this.$emit('close', {type: 'edit',cancel: false});
								this.getdl();
								this.cancel()
							} else {
								this.$message.warning(res.data.msg);
 								this.$store.state.loading = false;
							}
						}).catch(res => {
 							this.$message.warning("服务器异常");
							this.searchLoading = false;
						})
				}).catch(() => {
					this.$message({type: 'info',message: '已取消'});
				});

			},
			getdl() {
				var logininfo = JSON.parse(localStorage.logininfo);
				var params2 = qs.stringify({
					yhid: logininfo.id,
					xxid: logininfo.xxid
				})
				//执行
				this.axios.post(this.$store.state.api + 'ls/sxym', params2)
					.then(res => {
						localStorage.setItem('logininfo', JSON.stringify(res.data.data.list[0]))
						//console.log(JSON.parse(localStorage.logininfo))
						this.$emit('close', { type: 'add',cancel: true})
						location.reload()
					})
			},
			jiesan() {
				this.$confirm('此操作将解散该班级, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					var logininfo = JSON.parse(localStorage.logininfo);
					var params2 = qs.stringify({
						yhid: logininfo.id,
						xxid: logininfo.xxid,
						ysbjid: this.form.id
					})
					//执行
					this.axios.post(this.$store.state.api + 'ysbj/jsbj', params2)
						.then(res => {
							if(res.data.code == '1') {
								this.$emit('close', {
									type: 'edit',
									cancel: false
								});
								this.$message.warning(res.data.msg)
								//						this.$message({
								//							type: 'success',
								//							message: '解散成功!'
								//						});
								//						this.$emit('close', { type: 'edit', cancel: false });
								// console.log(res)
								this.cancel()
							} else {
								this.$message.warning(res.data.msg)
								//						this.$message({
								//							type: 'error',
								//							message: '操作不成功:'+res.data.msg
								//						});
							}
						}).catch(res => {
							console.log(res)
							this.searchLoading = false;
						})
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消'
					});
				});

			},
			submit(type) {
				//装载数据
				var time1 = this.$.getLocalTimeNo0(Date.parse(this.form.yjkbrq));
				var logininfo = JSON.parse(localStorage.logininfo);
				var params2 = qs.stringify({
					kscnt: this.form.kscnt + '',
					fxkcid: this.form.fxkcid + '',
					kbrq: time1,
					xzid: this.form.xzid + '',
					jcid: this.form.jcid + '',
					lsid: this.form.lsid + '',
					mc: this.form.mc + '',
					id: this.form.id + '',
					yhid: logininfo.id + '',
					xxid: logininfo.xxid + ''
				})
				//执行
				this.axios.post(this.$store.state.api + 'bj/updatebj', params2)
					.then(res => {
						if(type == 1) {
							if(res.data.code == 1) {
								this.$message.success("保存成功!!");
								// this.bccl()
								// this.$emit('close', { type: 'edit', cancel: false });
								// this.$store.state.loading = false;
							} else {
								this.$message.success(res.data.msg);
								this.$emit('close', {type: 'edit',cancel: false});
							}
						} else {
							this.showjslskblist = true;
						}

					}).catch(res => {
						this.$message.warning("服务器异常");
					})
			},
			bccl() {
				var sjdid = "";
				for(var i in this.cllist) {
					sjdid = sjdid + ',' + this.cllist[i].id
				}
				var logininfo = JSON.parse(localStorage.logininfo);
				var params2 = qs.stringify({
					sjdid: sjdid,
					day: '1', //排课开始day
					kscnt: this.form.kscnt + '',
					bjid: this.form.id + '',
					yhid: logininfo.id + '',
					xxid: logininfo.xxid + ''
				})
				this.axios.post(this.$store.state.api + 'bj/insertcl', params2)
					.then(res => {
						if(res.data.code == 1) {
							this.$emit('close', {type: 'edit',cancel: false});
							this.$message.success("保存成功!!");
						} else {
							this.$message.warning(res.data.msg);
						}
					}).catch(res => {
						this.$message.warning("服务器异常");
					})

			},
			cancel() {
				this.$emit('close', {type: 'edit',cancel: true})
			},
			handleSizeChange(val) { //每页显示条数触发事件
				this.pagesize = val;
				this.pageindex = 1;
				// this.search();
			},
			handleCurrentChange(val) { //分页触发事件
				// this.search();
			},
			/* 组件的弹框  */
			componentsShow(type, data) { //显示组件
				for(let i in this.portComponents) {
					if(type == this.portComponents[i].type) {
						this.portComponents[i].toggle = true;
						this.portComponents[i].params = data;
						if(this.portComponents[i].data.type == 'single') {
							this.portComponents[i].data.index = data.row.id
						} else if(this.portComponents[i].data.type == 'multiple') {
							this.portComponents[i].data.index = this.multipleDelNum;
						} else {
							return;
						}
						return;
					}
				}
			},
			componentsHide(setting) { //关闭组件
				this.getkblist()
				for(let i in this.portComponents) {
					if(setting.type == this.portComponents[i].type) {
						this.portComponents[i].toggle = false;
						if(!setting.cancel) {
				          this.getkblist()
						}
						return;
					}
				}
			}
		}
	}
</script>
<style lang="less" scoped>
	.wrap {
		.red{
			background: #C0CCDA;
		}
		.red2{
			background: #fff;
		}
		.kblistul {
			width: 90%;
			text-align: center;
			margin: 0 auto;
			border: 1px solid;
			overflow: hidden;
			li {
				width: 12.5%;
				/*height: 150px;*/
				border: 1px solid;
				float: left;
			}
		}
		.tab {
			width: 93%;
			margin: 0 auto;
			border: 1px solid #D8DCE5;
			margin-top: 10px;
			tr {
				border: 1px solid #D8DCE5;
			}
			td {
				text-align: center;
				border: 1px solid #D8DCE5;
				div {
					height: 50%;
					line-height: 50px;
					border: 1px solid #D8DCE5;
				}
			}
		}
		.ullist {
			overflow: hidden;
			width: 100%;
			margin: 0 auto;
			text-align: center;
		}
		.row {
			height: 50px;
			line-height: 50px;
		}
		.bt {
			position: absolute;
			width: 100%;
			height: 50px;
			margin: 0 auto;
			top: 0;
			left: 0;
			// margin-top: -70px;
			background: #50BFFF;
			// margin-left: -20px;
			// margin-bottom: 20px;
			color: white;
			text-align: left;
			line-height: 50px;
			font-size: 17px;
			padding-left: 15px;
		}
		.close {
			z-index: 10;
			position: absolute;
		}
		.input-block {
			margin-bottom: 20px;
			text-align: center;
		}
		.input {
			width: 280px;
			display: inline-block;
			margin-left: 10px;
		}
		.input1 {
			width: 210px;
			display: inline-block;
			margin-left: 10px;
		}
		.input-block span {
			display: inline-block;
			width: 70px;
			text-align: right;
		}
		.submit {
			width: 120px;
			display: block;
			margin: 0 auto;
		}
		.wpfl {
			background: #fff;
			position: absolute;
			top: 5px;
			left: 5px;
		}
		.wpfl1 {
			width: 100%;
			background: #fff;
			position: absolute;
			top: 5px;
			left: -66px;
		}
		.lskb {
			width: 140%;
			background: #fff;
			position: absolute;
			top: -100px;
			left: -20%;
			z-index: 50;
			padding-bottom: 100px;
		}
		.form {
			text-align: left;
			margin-top: 10px;
			.zzz {
				overflow: hidden;
			}
			.select-block {
				width: 85%;
				display: block;
			}
			.select-block1 {
				width: 63%;
				// display: block;
			}
			.select-block3 {
				width: 50%;
				// display: block;
			}
			.zjselect-block {
				width: 20%;
				float: left;
				display: block;
			}
			.el-form-item {
				margin-bottom: 10px;
			}
			.weekdiv {
				width: 100%;
				height: 100%;
				margin: 0 auto;
				background: lightblue;
			}
			.wdiv0 {
				line-height: 45px;
				width: 110px;
				float: left;
				background: lightgoldenrodyellow;
			}
			.wdiv1 {
				width: 50px;
				float: left;
				background: lightgoldenrodyellow;
			}
			.wdiv2 {
				width: 50px;
				float: left;
				background: lightgoldenrodyellow;
			}
			.wdiv3 {
				width: 50px;
				float: left;
				background: lightgoldenrodyellow;
			}
			.wdiv4 {
				width: 50px;
				float: left;
				background: lightgoldenrodyellow;
			}
			.wdiv5 {
				width: 50px;
				float: left;
				background: lightgoldenrodyellow;
			}
			.wdiv6 {
				width: 50px;
				float: left;
				background: lightgoldenrodyellow;
			}
			.wdiv7 {
				width: 50px;
				float: left;
				background: lightgoldenrodyellow;
			}
			.el-checkbox+.el-checkbox {
				margin-left: 0px;
			}
			.el-button+.el-button {
				margin-left: 0px;
			}
		}
	}
</style>